package org.zxp.designpattern.decorator;

/**
 * @program: effectiveJava
 * @description: GetFreeMemory的装饰器，用于获得内存信息额外增加当前服务器时间的信息
 * @author: X-Pacific zhang
 * @create: 2019-08-23 11:28
 **/
public class GetFreeMemoryDecoator implements GetMsg{
    GetFreeMemory getFreeMemory;
    public GetFreeMemoryDecoator(GetFreeMemory getFreeMemory){
        this.getFreeMemory = getFreeMemory;
    }

    @Override
    public String getlong() {
        long cTime = System.currentTimeMillis();
        return "当前时间："+cTime+" 当前剩余内存："+getFreeMemory.getlong();
    }

}
